using System.ComponentModel;

namespace AuthService.Domain.Tokens
{
    /// <summary>
    /// 令牌类型枚举
    /// </summary>
    public enum TokenType
    {
        /// <summary>
        /// 访问令牌
        /// </summary>
        [Description("访问令牌")]
        AccessToken = 0,

        /// <summary>
        /// 刷新令牌
        /// </summary>
        [Description("刷新令牌")]
        RefreshToken = 1,

        /// <summary>
        /// ID令牌
        /// </summary>
        [Description("ID令牌")]
        IdToken = 2,

        /// <summary>
        /// 授权码
        /// </summary>
        [Description("授权码")]
        AuthorizationCode = 3,

        /// <summary>
        /// 设备码
        /// </summary>
        [Description("设备码")]
        DeviceCode = 4,

        /// <summary>
        /// 客户端凭证令牌
        /// </summary>
        [Description("客户端凭证令牌")]
        ClientCredentialsToken = 5,

        /// <summary>
        /// 密码重置令牌
        /// </summary>
        [Description("密码重置令牌")]
        PasswordResetToken = 6,

        /// <summary>
        /// 邮箱验证令牌
        /// </summary>
        [Description("邮箱验证令牌")]
        EmailVerificationToken = 7,

        /// <summary>
        /// 手机验证令牌
        /// </summary>
        [Description("手机验证令牌")]
        PhoneVerificationToken = 8,

        /// <summary>
        /// 双因子认证令牌
        /// </summary>
        [Description("双因子认证令牌")]
        TwoFactorAuthToken = 9,

        /// <summary>
        /// 会话令牌
        /// </summary>
        [Description("会话令牌")]
        SessionToken = 10,

        /// <summary>
        /// API密钥
        /// </summary>
        [Description("API密钥")]
        ApiKey = 11,

        /// <summary>
        /// 一次性令牌
        /// </summary>
        [Description("一次性令牌")]
        OneTimeToken = 12,

        /// <summary>
        /// 服务到服务令牌
        /// </summary>
        [Description("服务到服务令牌")]
        ServiceToServiceToken = 13,

        /// <summary>
        /// 临时令牌
        /// </summary>
        [Description("临时令牌")]
        TemporaryToken = 14,

        /// <summary>
        /// 长期令牌
        /// </summary>
        [Description("长期令牌")]
        LongLivedToken = 15
    }

    /// <summary>
    /// 令牌状态枚举
    /// </summary>
    public enum TokenStatus
    {
        /// <summary>
        /// 活跃
        /// </summary>
        [Description("活跃")]
        Active = 0,

        /// <summary>
        /// 已过期
        /// </summary>
        [Description("已过期")]
        Expired = 1,

        /// <summary>
        /// 已撤销
        /// </summary>
        [Description("已撤销")]
        Revoked = 2,

        /// <summary>
        /// 已使用
        /// </summary>
        [Description("已使用")]
        Used = 3,

        /// <summary>
        /// 已挂起
        /// </summary>
        [Description("已挂起")]
        Suspended = 4,

        /// <summary>
        /// 已锁定
        /// </summary>
        [Description("已锁定")]
        Locked = 5,

        /// <summary>
        /// 无效
        /// </summary>
        [Description("无效")]
        Invalid = 6,

        /// <summary>
        /// 待验证
        /// </summary>
        [Description("待验证")]
        PendingVerification = 7,

        /// <summary>
        /// 黑名单
        /// </summary>
        [Description("黑名单")]
        Blacklisted = 8
    }

    /// <summary>
    /// 令牌用途枚举
    /// </summary>
    public enum TokenPurpose
    {
        /// <summary>
        /// 登录
        /// </summary>
        [Description("登录")]
        Login = 0,

        /// <summary>
        /// API访问
        /// </summary>
        [Description("API访问")]
        ApiAccess = 1,

        /// <summary>
        /// 密码重置
        /// </summary>
        [Description("密码重置")]
        PasswordReset = 2,

        /// <summary>
        /// 邮箱验证
        /// </summary>
        [Description("邮箱验证")]
        EmailVerification = 3,

        /// <summary>
        /// 手机验证
        /// </summary>
        [Description("手机验证")]
        PhoneVerification = 4,

        /// <summary>
        /// 双因子认证
        /// </summary>
        [Description("双因子认证")]
        TwoFactorAuthentication = 5,

        /// <summary>
        /// 账户激活
        /// </summary>
        [Description("账户激活")]
        AccountActivation = 6,

        /// <summary>
        /// 设备注册
        /// </summary>
        [Description("设备注册")]
        DeviceRegistration = 7,

        /// <summary>
        /// 授权
        /// </summary>
        [Description("授权")]
        Authorization = 8,

        /// <summary>
        /// 会话管理
        /// </summary>
        [Description("会话管理")]
        SessionManagement = 9,

        /// <summary>
        /// 权限提升
        /// </summary>
        [Description("权限提升")]
        PrivilegeEscalation = 10,

        /// <summary>
        /// 管理操作
        /// </summary>
        [Description("管理操作")]
        AdministrativeOperation = 11,

        /// <summary>
        /// 第三方集成
        /// </summary>
        [Description("第三方集成")]
        ThirdPartyIntegration = 12,

        /// <summary>
        /// 系统维护
        /// </summary>
        [Description("系统维护")]
        SystemMaintenance = 13,

        /// <summary>
        /// 审计追踪
        /// </summary>
        [Description("审计追踪")]
        AuditTrail = 14,

        /// <summary>
        /// 备份恢复
        /// </summary>
        [Description("备份恢复")]
        BackupRestore = 15
    }

    /// <summary>
    /// 刷新令牌策略枚举
    /// </summary>
    public enum RefreshTokenPolicy
    {
        /// <summary>
        /// 单次使用
        /// </summary>
        [Description("单次使用")]
        SingleUse = 0,

        /// <summary>
        /// 多次使用
        /// </summary>
        [Description("多次使用")]
        Reusable = 1,

        /// <summary>
        /// 滑动过期
        /// </summary>
        [Description("滑动过期")]
        SlidingExpiration = 2,

        /// <summary>
        /// 绝对过期
        /// </summary>
        [Description("绝对过期")]
        AbsoluteExpiration = 3,

        /// <summary>
        /// 自适应策略
        /// </summary>
        [Description("自适应策略")]
        AdaptivePolicy = 4,

        /// <summary>
        /// 基于风险策略
        /// </summary>
        [Description("基于风险策略")]
        RiskBasedPolicy = 5,

        /// <summary>
        /// 基于设备策略
        /// </summary>
        [Description("基于设备策略")]
        DeviceBasedPolicy = 6,

        /// <summary>
        /// 基于位置策略
        /// </summary>
        [Description("基于位置策略")]
        LocationBasedPolicy = 7
    }

    /// <summary>
    /// 令牌加密算法枚举
    /// </summary>
    public enum TokenEncryptionAlgorithm
    {
        /// <summary>
        /// 无加密
        /// </summary>
        [Description("无加密")]
        None = 0,

        /// <summary>
        /// HS256
        /// </summary>
        [Description("HS256")]
        HS256 = 1,

        /// <summary>
        /// HS384
        /// </summary>
        [Description("HS384")]
        HS384 = 2,

        /// <summary>
        /// HS512
        /// </summary>
        [Description("HS512")]
        HS512 = 3,

        /// <summary>
        /// RS256
        /// </summary>
        [Description("RS256")]
        RS256 = 4,

        /// <summary>
        /// RS384
        /// </summary>
        [Description("RS384")]
        RS384 = 5,

        /// <summary>
        /// RS512
        /// </summary>
        [Description("RS512")]
        RS512 = 6,

        /// <summary>
        /// ES256
        /// </summary>
        [Description("ES256")]
        ES256 = 7,

        /// <summary>
        /// ES384
        /// </summary>
        [Description("ES384")]
        ES384 = 8,

        /// <summary>
        /// ES512
        /// </summary>
        [Description("ES512")]
        ES512 = 9,

        /// <summary>
        /// PS256
        /// </summary>
        [Description("PS256")]
        PS256 = 10,

        /// <summary>
        /// PS384
        /// </summary>
        [Description("PS384")]
        PS384 = 11,

        /// <summary>
        /// PS512
        /// </summary>
        [Description("PS512")]
        PS512 = 12
    }

    /// <summary>
    /// 令牌存储方式枚举
    /// </summary>
    public enum TokenStorageMode
    {
        /// <summary>
        /// 无状态JWT
        /// </summary>
        [Description("无状态JWT")]
        StatelessJwt = 0,

        /// <summary>
        /// 数据库存储
        /// </summary>
        [Description("数据库存储")]
        Database = 1,

        /// <summary>
        /// Redis缓存
        /// </summary>
        [Description("Redis缓存")]
        Redis = 2,

        /// <summary>
        /// 分布式缓存
        /// </summary>
        [Description("分布式缓存")]
        DistributedCache = 3,

        /// <summary>
        /// 内存缓存
        /// </summary>
        [Description("内存缓存")]
        MemoryCache = 4,

        /// <summary>
        /// 混合存储
        /// </summary>
        [Description("混合存储")]
        Hybrid = 5,

        /// <summary>
        /// 区块链
        /// </summary>
        [Description("区块链")]
        Blockchain = 6,

        /// <summary>
        /// 安全存储
        /// </summary>
        [Description("安全存储")]
        SecureStorage = 7
    }
}